package org.idea.qiyu.framework.docker.compose.dao;

import org.idea.qiyu.framework.docker.compose.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;


/**
 * @Author linhao
 * @Date created in 3:42 下午 2021/7/9
 */
@Repository
public class UserDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void addUser(){
        User user = new User();
        user.setUsername("user-1");
        jdbcTemplate.update("insert t_user values(?,?)",new Object[]{user.getId(),user.getUsername()});
        System.out.println("insert success");
    }
}
